<?php 
  $x = 1+$offset;
  // echo $offset;
  foreach ($journey as $key) {
    echo '<tr class="'.$key->user_id.'">';
    echo '<td>'.$x++.'</td>';
    echo '<td>'.$key->channel_id.'</td>';
    echo '<td>'.$key->channel_name.'</td>';
    if($key->user_id)
      { echo '<td>'.$key->user_id.' | '.$key->user_name.' | '.$key->user_group.'</td>'; }
    else
      { echo '<td style="background: #ff0"> Unmaintaned </td>'; }
    echo '<td>'.$key->lokasi.'</td>';
    
    if($key->jc9 == 1 || $key->jc8 == 1)
      { echo '<td style="background: #ACE600">Ada</td>'; }
    else
      { echo '<td>Tidak</td>'; }
    if($key->jc == 1)
      { echo '<td> <input type="checkbox" name="journey" class="jc" id="'.$key->channel_id.'_'.$key->territory_id.'_'.$date[0].$date[1].'_d'.$date[2].'" onchange="simpan(\''.$key->channel_id.'_'.$key->territory_id.'_'.$date[0].$date[1].'_d'.$date[2].'\')" checked="checked" /></td>';}
    else
      { echo '<td> <input type="checkbox" name="journey" class="jc" id="'.$key->channel_id.'_'.$key->territory_id.'_'.$date[0].$date[1].'_d'.$date[2].'" onchange="simpan(\''.$key->channel_id.'_'.$key->territory_id.'_'.$date[0].$date[1].'_d'.$date[2].'\')" /></td>';}
    echo '</tr>';
  }
?>
